<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>17商城</title>
    <link type="text/css" href="css/css.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <script src="js/wb.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/MagicZoom.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $.get("${pageContext.request.contextPath}/goodsType", data => {
                let str = ""
                console.log(data);
                Array.from(data)
                for (let i = 0; i < data.length; i++) {
                    str += `<li><a href='${pageContext.request.contextPath}/goods?tid=` + data[i].tid + `'>` + data[i].tname + `</a></li>`
                }
                $("#t001").html(str)
                $("#t002").html(str)
            }, "json")

        })
    </script>
</head>

<body>
<div class="mianCont">
    <div class="top">
        <span>您好！欢迎来到91商城 请&nbsp;<a href="login.jsp">[登录]</a>&nbsp;<a href="reg.jsp">[注册]</a></span>
        <span class="topRight">
    <a href="vip.jsp">我的91</a>&nbsp;|
    <a href="order.jsp">我的订单</a>&nbsp;|
    <a href="login.jsp">会员中心</a>&nbsp;|
    <a href="contact.jsp">联系我们</a>
   </span>
    </div><!--top/-->
    <div class="lsg">
        <h1 class="logo"><a href="index.jsp"><img src="images/logo.png" width="217" height="90"/></a></h1>
        <form action="#" method="get" class="subBox">
            <div class="subBoxDiv">
                <input type="text" class="subLeft"/>
                <input type="image" src="images/subimg.png" width="63" height="34" class="sub"/>


            </div><!--subBoxDiv/-->
        </form><!--subBox/-->
        <div class="gouwuche">
            <div class="gouCar">
                <img src="images/gouimg.png" width="19" height="20" style="position:relative;top:6px;"/>&nbsp;|&nbsp;
                <strong class="red">0</strong>&nbsp;件&nbsp;|
                <strong class="red">￥ 0.00</strong>
                <a href="order.jsp">去结算</a> <img src="images/youjian.jpg" width="5" height="8"/>
            </div><!--gouCar/-->
            <div class="myChunlv">
                <a href="vip.jsp"><img src="images/mychunlv.jpg" width="112" height="34"/></a>
            </div><!--myChunlv/-->
        </div><!--gouwuche/-->
    </div><!--lsg/-->

    <div class="pnt">
        <div class="pntLeft">
            <h2 class="Title">所有商品分类
                <ul class="InPorNav">
                    <div id="t001"></div>
                </ul><!--InPorNav/-->
            </h2>
        </div><!--pntLeft/-->
        <div class="pntRight">
            <ul class="nav">
                <li><a href="index.jsp">商城首页</a></li>
                <div id="t002"></div>
                <div class="clears"></div>
                <div class="phone">TEL：19 9个9</div>
            </ul><!--nav/-->
        </div><!--pntRight/-->
        <div class="clears"></div>
    </div><!--pnt/-->

    <div class="positions">
        当前位置：<a href="index.jsp">首页</a> &gt; <a href="#" class="posCur">商品详情</a>
    </div><!--positions/-->
    <div class="cont">
        <div class="contRight" style="border:0;">
            <div class="proBox">
                <div id="tsShopContainer">
                    <div id="tsImgS"><a href="${pageContext.request.contextPath}/gimages/${goods.g_img}" title="Images" class="MagicZoom" id="MagicZoom"><img
                            width="300" height="300" src="${pageContext.request.contextPath}/gimages/${goods.g_img}"/></a></div>
                    <img class="MagicZoomLoading" width="16" height="16" src="images/loading.gif" alt="Loading..."/>
                    <script src="js/ShopShow.js"></script>
                </div><!--tsShopContainer/-->
                <div class="proBoxRight">
                    <h3 class="proTitle">${goods.gname}</h3>
                    <div>商品编号： ${goods.gid}</div>
                    <div>会员价：<strong class="red">¥${goods.price}</strong></div>
                    <div>库存：<strong class="red">[${goods.gnum}] </strong> 从上海发货</div>

                    <div class="gc">

                        <form action="${pageContext.request.contextPath}/addCart" method="post">
                                购买数量<input type="text" value="1" name="num" style=" width: 50px"/>
                                <input type="hidden" name="gid" value="${goods.gid}">
                                <input type="hidden" name="g_img" value="${goods.g_img}">
                                <input type="hidden" name="gname" value="${goods.gname}">
                                <input type="hidden" name="price" value="${goods.price}">
                            <br/><br/>
                                <input id="a" value="加入购物车" type="image" src="images/shoucang.png" style="background: #5e9f22">
                        </form>
<%--                        <a href=""><img src="images/shoucang.png" width="117" height="36" title="加入购物车" id="a"/></a>--%>
                        <script type="text/javascript">
                            $(function () {
                                $("#a").click(function () {
                                    alert("添加成功！")
                                })
                            })
                        </script>
                    </div><!--gc/-->
                </div><!--proRight/-->
                <div class="clears"></div>
            </div><!--proBox/-->
            <ul class="fangyuan">
                <li>商品描述</li>
                <li>商品参数</li>
                <li>商品评论</li>
                <li>商品晒图</li>
                <div class="clears"></div>
            </ul><!--fangyuan/-->
            <div class="fangList">
                <%--        ==========================================          --%>
                <div class="fangPar">${goods.gdesc} </div><!--fangPar/-->
                <%--        ==========================================          --%>
                <img src="${pageContext.request.contextPath}/gimages/${goods.g_img}" width="500" height="360"/>
            </div><!--fangList/-->
            <div class="fangList">
                商品参数
            </div><!--fangList/-->
            <div class="fangList">
                商品评论
            </div><!--fangList/-->
            <div class="fangList">
                <img src="images/rdPro1.jpg" width="132" height="129"/><br/><br/>
                <img src="images/rdPro2.jpg" width="132" height="129"/><br/><br/>
                <img src="images/rdPro3.jpg" width="132" height="129"/><br/><br/>
                <img src="images/rdPro4.jpg" width="132" height="129"/><br/><br/>
                <img src="images/rdPro5.jpg" width="132" height="129"/><br/><br/>
            </div><!--fangList/-->
        </div><!--contRight/-->
        <div class="clears"></div>
    </div><!--cont/-->

</div><!--mianCont/-->
<a href="#" class="backTop">&nbsp;</a>
</body>
</html>
